package homework;

import io.Person;

import java.io.*;

public class Test03 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        File file = new File(".");
        if (file.isDirectory()){
            File[] subs = file.listFiles(f -> f.getName().endsWith(".obj"));
            for (int i = 0; i < subs.length; i++) {
                FileInputStream fis = new FileInputStream(subs[i]);
                ObjectInputStream ois = new ObjectInputStream(fis);
                Person p = (Person) ois.readObject();
                System.out.println(p);
            }
        }

    }
}
